﻿// ------------------------------------------------------------------------------------
//      Copyright (c) uhavemyword@gmail.com. All rights reserved.
//      Created by Ben at 2/20/2013 4:03:13 PM
// ------------------------------------------------------------------------------------

namespace CP.NLayer.Models.Business
{
    using System.Collections.Generic;
    using CP.NLayer.Models.Entities;
    using System.ComponentModel.DataAnnotations;
    using CP.NLayer.Resources.Model;

    public class UserEditModel : ModelBase
    {
        public User User { get; set; }

        [Display(Name = MResourceNames.Password, ResourceType = typeof(MResources))]
        public string Password { get; set; }

        public IList<CheckListItem> RoleList { get; set; }

        public override string ToString()
        {
            return this.User.LoginName;
        }

        public override string GetValidationErrors()
        {
            if (User == null)
            {
                return string.Empty;
            }
            return User.GetValidationErrors();
        }
    }
}
